cmake_minimum_required(VERSION 3.28.3)
project(c_demo C)

set(CMAKE_C_STANDARD 11)


# 查找 GTK3
find_package(PkgConfig REQUIRED)
pkg_check_modules(GTK3 REQUIRED gtk+-3.0)

#查找SQLite3
find_package(SQLite3 REQUIRED)

# 包含 GTK3 头文件目录
include_directories(${GTK3_INCLUDE_DIRS})
link_directories(${GTK3_LIBRARY_DIRS})
add_definitions(${GTK3_CFLAGS_OTHER})

# 添加可执行文件
add_executable(c_demo main.c
        db_demo.c
        socket_server_demo.c
)

# 链接 GTK3 库 注意改项目名称
target_link_libraries(c_demo ${GTK3_LIBRARIES})
# 链接 SQLite3 库
target_link_libraries(c_demo SQLite::SQLite3)


